import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:winkai/ext/screen_ext.dart';

class ChatMsgBgWidget extends StatelessWidget {
  final bool isSend;
  final Widget child;
  final EdgeInsetsGeometry? padding;

  const ChatMsgBgWidget({
    super.key,
    required this.isSend,
    required this.child,
    this.padding,
  });

  @override
  Widget build(BuildContext context) {
    return Container(
        padding: padding ?? EdgeInsets.all(12.w),
        constraints: BoxConstraints(maxWidth: screenWidth - 120.w),
        decoration: BoxDecoration(
          color: isSend ? const Color(0xffF2FFB4) : Colors.white,
          borderRadius: BorderRadius.circular(16),
        ),
        child: child);
  }
}
